package com.jrx.anytxn.transaction.service;


import com.jrx.anytxn.common.exception.TxnException;
import com.jrx.anytxn.i18n.response.TxnPage;
import com.jrx.anytxn.transaction.bean.ChargeoffBean;
import com.jrx.anytxn.transaction.bean.ChargeoffPaymentBean;
import com.jrx.anytxn.transaction.dto.chargeoff.TlChargeoffRep;
import com.jrx.anytxn.transaction.dto.chargeoff.TlChargeoffRes;
import com.jrx.anytxn.transaction.entity.TlChargeoffInfo;

public interface IChargeoffService {

    /**
     * 添加核销订单信息
     *
     * @param chargeoffRep 请求参数
     * @return ChargeoffRes
     * @author lbz
     */
    TlChargeoffRes addChargeoff(TlChargeoffRep chargeoffRep) throws TxnException;

    /**
     * 根据订单号 租户号 查询核销信息
     * @param loanId
     * @param tenantId
     * @param pageNum
     * @param pageSize
     * @return
     * @throws TxnException
     */
    TxnPage<TlChargeoffRes> getChargeoffByLoanId(String loanId, String tenantId,Integer pageNum,Integer pageSize) throws TxnException;

    /**
     * 根据订单号 客户号 租户号 组装核销信息
     * @param loanId
     * @param customerId
     * @param tenantId
     * @return
     * @throws TxnException
     */
    TlChargeoffRes processChargeoffByLoanId(String loanId,String tenantId) throws TxnException;


    /**
     * 根据订单号修改核销信息 只能修改 核销原因码 与 核销描述
     * @param chargeoffRep
     * @return
     * @throws TxnException
     */
    TlChargeoffRes editChargeoff(TlChargeoffRep chargeoffRep) throws TxnException;

    /**
     * 根据id编号 租户号 删除核销订单
     * @param tenantId
     * @param id
     * @return
     * @throws TxnException
     */
    Boolean removeByTenIdAndLoanId(String tenantId,String customerId,Long id) throws TxnException;

    /**
     * 核销订单处理
     * @param tlChargeoffInfo
     * @return
     * @throws Exception
     */
    ChargeoffBean processChargeoff(TlChargeoffInfo tlChargeoffInfo) throws Exception;

    /**
     * 核销自动扣款
     * @param tlChargeoffInfo
     * @return
     * @throws Exception
     */
    ChargeoffPaymentBean chargeoffPay(TlChargeoffInfo tlChargeoffInfo) throws Exception;

    /**
     * 根据主键ID 客户编号 租户查询核销信息
     * @param id
     * @param customerId
     * @param tenantId
     * @return
     * @throws TxnException
     */
    TlChargeoffRes getChargeoffById(Long id, String customerId, String tenantId) throws TxnException;




}
